<template>
  <web-table
    :options="options"
    :list-query="listQuery"
  >

    <template #filter-content>

      <el-input
        v-model="listQuery.params.refRemark"
        class="filter-item"
        size="small"
        placeholder="搜索积分来源"
        prefix-icon="el-icon-search"
        style="width: 300px"
      />

    </template>

    <template #data-columns>

      <el-table-column
        label="获取来源"
        prop="refRemark"
      />

      <el-table-column
        label="获得时间"
        align="center"
        prop="createTime"
      />

      <el-table-column
        label="积分数量"
        align="right"
        prop="points"
      >

        <template v-slot="scope">
          <span v-if="scope.row.points > 0" style="font-weight: 700; color: orange">
            + {{ scope.row.points }}
          </span>
          <span v-else style="font-weight: 700; color: red">
            {{ scope.row.points }}
          </span>
        </template>

      </el-table-column>

    </template>

  </web-table>
</template>

<script>
import WebTable from '@/components/WebTable'

export default {
  name: 'MyPointsLog',
  components: { WebTable },
  data() {
    return {
      listQuery: {
        current: 1,
        size: 10,
        params: {
        }
      },

      options: {
        // 列表请求URL
        listUrl: '/api/user/points/my-paging'
      }
    }
  }
}
</script>

<style scoped>

  ::v-deep
  .search-area{
    display: none;
  }
</style>
